//==========================================================================
/**
* @file	  : Game.h
* @author : cpzhang <chengpengzhang@gmail.com>
* created : 2010-4-29   18:27
* purpose : 
*/
//==========================================================================

#ifndef __Game_h__
#define __Game_h__

//
#include "Common.h"

//
namespace Buddha
{
	class _BUHHDA_EXPORT_ Game
	{
	public:
		Game();
		~Game();
	public:
		//
		virtual bool forePlay();
		
		//
		virtual bool play();
		
		//
		virtual bool postPlay();

		//
		virtual bool update();

		//
		virtual bool foreRender();

		//
		virtual bool rendering();

		//
		virtual bool postRender();

		//
		virtual void onDragAndDrop();

	public:
		//
		bool doing();

		//
		bool render();

		//
		bool createWindow();

		//
		bool adjustClientArea();

		//
		void setWindowTitle(const std::string& title);

	public:
		// The window procedure, hands events the window receives
		static LRESULT CALLBACK _wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	protected:
		//
		static std::string	_dragDropFile;

		//
		std::string		_windowName;

		//
		std::string		_windowTitle;

		//
		unsigned int	_clientWidth;

		//
		unsigned int	_clientHeight;

		//
		unsigned int	_windowX;

		//
		unsigned int	_windowY;

		//
		HWND			_hwnd;

		//
		float			_fps;
	};
}

#endif // __Game_h__
